<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<span onclick="var c = 'jack';alert('bb');fun()">这里是文字，可以点的</span>
<script>
  function fun(){
      var b = 'tom';
      alert(b);
  }

</script>
</body>
</html>